home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c
- Subject: Re: Is it possible?
- Date: Thu, 25 Jan 1996 00:14:31 GMT
- Organization: Netcom
- Message-ID: <3106bfd8.6942016@nntp.ix.netcom.com>
- References: <4e5kuq$9i7@news.ust.hk>
- NNTP-Posting-Host: ix-dc14-03.ix.netcom.com
- X-NETCOM-Date: Wed Jan 24 4:14:34 PM PST 1996
- X-Newsreader: Forte Agent .99c/16.141
-
- ee_chung@uxmail.ust.hk (Chu Shiu Chung) wrote:
-
- >
- > Hello,
- >
- > If I have declare the following:
- > #define FILENUM 12
- >
- > Is it possible to make the compiler to replace this in printf:
- > printf("FILENUM is the number of files");
- > instead of
- > printf("%d is the number of files", FILENUM);
- >
- > Just like what the compiler do in: int a=FILENUM;
-
- #define num_to_string_really(x) #x
- #define num_to_string(x) num_to_string_really(x)
-
- printf(num_to_string(FILENUM) " is the number of files");
-
-
- Michael M Rubenstein
-